package com.fengwk.user.face.client;

import java.util.Collection;
import java.util.List;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.fengwk.user.face.client.hystrix.UserClientHystrix;
import com.fengwk.user.face.constant.UserServerConstant;
import com.fengwk.user.face.model.User;

import io.swagger.annotations.ApiParam;

@FeignClient(
		name = UserServerConstant.FEIGN_CLIENT_NAME, 
		path = "/api/user",
		fallback = UserClientHystrix.class)
public interface UserClient {
	
	/**
	 * 通过用户id获取User
	 * 
	 * @param userId 用户id
	 * @return
	 */
	@PostMapping("/getUserByUserId")
	public User getUserByUserId(
			@ApiParam(value = "用户id", required = true) @RequestParam(value = "userId", required = true) Long userId);

	
	/**
	 * 通过用户id列表获取User列表
	 * 
	 * @param userIds 用户id列表
	 * @return
	 */
	@PostMapping("/listUserByUserIds")
	public List<User> listUserByUserIds(
			@ApiParam(value = "用户id列表", required = true) @RequestParam(value = "userIds", required = true) Collection<Long> userIds);
	
}
